package com.deer.remote.server.rds.controller;

import com.deer.remote.common.protocol.Command;
import com.deer.remote.common.protocol.Message;
import com.deer.remote.common.protocol.Packet;
import com.deer.remote.server.rds.BaseMessageController;
import com.deer.remote.server.rds.TentacleDesktopSession;

/**
 * Created by matrixy on 2019/1/3. 受控端连接会话的心跳响应
 */
public class HeartbeatController extends BaseMessageController {
	static final Message OJBK = new Message().withCommand(Command.HEARTBEAT)
			.withBody(Packet.create(4).addBytes("OJBK".getBytes()));

	@Override
	public boolean authenticateRequired() {
		return false;
	}

	@Override
	public Message service(TentacleDesktopSession session, Message msg) {
		return OJBK;
	}
}
